#ifndef DATA_TRANS_H
#define DATA_TRANS_H

#include <magus/network/DatagramSocket.h>    /* for udp transformation */
#include "point.h"
#include "unilog.h"

int recv_from_udp(DatagramSocket				*udp_sock, 
				  std::map<std::string, point>	&m_points, 
				  std::vector<double>			&v_points, 
				  std::vector<int>				&pid, 
				  char							*buf);

int parse_udp_buf(char							*buf, 
				  int							buf_len,
				  std::map<std::string, point>	&m_points, 
				  std::vector<point>			&v_points);

int send_to_rtdb(std::string			ip, 
				 unsigned int			node_id, 
				 std::vector<double>	&value, 
				 std::vector<int>		&id, 
				 short					*type);

int init_socket(DatagramSocket *udp_sock, int port);

int main_proc();

#endif